﻿<UserControl x:Class="Brjnk.GpxExplorer.UI.GoToCoordinatesPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:l="clr-namespace:Brjnk.GpxExplorer.Localization"
             xmlns:workspace="clr-namespace:Brjnk.GpxExplorer.Workspace"
             mc:Ignorable="d">
    <StackPanel Orientation="Horizontal" DataContext="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
        <StackPanel.Resources>
            <Style TargetType="Button">
                <Setter Property="Margin" Value="1" />
            </Style>
        </StackPanel.Resources>

        <Button MinWidth="0"
                Visibility="{Binding  Path=IsMoveablePoint, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding Source={workspace:GetWorkspace}, Path=Editor.MoveCommand}"
                CommandParameter="{Binding PointObject}"
                ToolTip="{l:Loc coordinatesPanelMovePoint}">
            <Image Height="16" Source="/Resources/Icons/Move.png" />
        </Button>

        <Button MinWidth="0"
                 Visibility="{Binding Path=ButtonGoTo, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding Source={workspace:GetWorkspace}, Path=DataView.GoToCoordinatesCommand}"
                CommandParameter="{Binding CoordinatesInternal}"
                ToolTip="{l:Loc coordinatesPanelShowPosition}">
            <Image Height="16" Source="/Resources/Icons/View.png" />
        </Button>

        <Button MinWidth="0"
                 Visibility="{Binding  Path=ButtonGoToBigZoom, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding Source={workspace:GetWorkspace}, Path=DataView.GoToCoordinatesBigZoomCommand}"
                CommandParameter="{Binding CoordinatesInternal}"
                ToolTip="{l:Loc coordinatesPanelShowPosition}">
            <StackPanel Orientation="Horizontal">
                <Image Height="16" Source="/Resources/Icons/View.png" />
                <Image Height="16" Source="/Resources/Icons/plus16.png" />
            </StackPanel>
        </Button>

        <Button MinWidth="0"
                 Visibility="{Binding  Path=ButtonAddPushpinAndGoTo, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding Source={workspace:GetWorkspace}, Path=SearchService.PushpinsManager.AddPushpinAndGoCommand}"
                CommandParameter="{Binding PointObject}"
                ToolTip="{l:Loc coordinatesPanelShowPosition}">
            <Image Height="16" Source="/Resources/Icons/map16.png" />
        </Button>

        <Button MinWidth="0"
                 Visibility="{Binding  Path=ButtonAddPushpinAndGoToBigZoom, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding Source={workspace:GetWorkspace}, Path=SearchService.PushpinsManager.AddPushpinAndGoBigZoomCommand}"
                CommandParameter="{Binding PointObject}"
                ToolTip="{l:Loc coordinatesPanelShowPosition}">
            <StackPanel Orientation="Horizontal">
                <Image Height="16" Source="/Resources/Icons/map16.png" />
                <Image Height="16" Source="/Resources/Icons/plus16.png" />
            </StackPanel>
        </Button>

        <Button MinWidth="0"
                 Visibility="{Binding  Path=ButtonAddPushpin, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding Source={workspace:GetWorkspace}, Path=SearchService.PushpinsManager.AddPushpinCommand}"
                CommandParameter="{Binding PointObject}"
                ToolTip="{l:Loc coordinatesPanelCreatePushpin}">
            <Image Height="16" Source="/Resources/Icons/PushpinSymbol.png" />
        </Button>

        <Button MinWidth="0"
                Visibility="{Binding  Path=ButtonCopyToClipboard, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding CopyToClipboardCommand}"
                CommandParameter="{Binding CoordinatesInternal}"
                ToolTip="{l:Loc coordinatesPanelCopyToClipboard}">
            <Image Height="16" Source="/Resources/Icons/Clipboard16.png" />
        </Button>

        <Button MinWidth="0"
                 Visibility="{Binding  Path=ButtonCreateWaypoint, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="{Binding Source={workspace:GetWorkspace}, Path=Editor.CreateWaypointCommand}"
                CommandParameter="{Binding PointObject}">
            <Image Height="16" Source="/Resources/Icons/AddWaypoint.png" />
        </Button>
    </StackPanel>
</UserControl>